package com.meixiang.entity.shopping;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 组合商品（套装）
 *
 * @author LZRUI
 */
public class GoodsGroupEntity implements Parcelable {

    private String goodsId; // 组合商品id
    private String goodsStorePrice;// 商品店铺价格
    private String goodsMarketPrice;// 商品市场价格
    private String benefit; // 优惠
    private String[] goodsSpecArray; // 套装中的商品列表

    public GoodsGroupEntity() {

    }

    public GoodsGroupEntity(String goodsId, String goodsStorePrice, String goodsMarketPrice, String benefit, String[] goodsSpecArray) {
        this.goodsId = goodsId;
        this.goodsStorePrice = goodsStorePrice;
        this.goodsMarketPrice = goodsMarketPrice;
        this.benefit = benefit;
        this.goodsSpecArray = goodsSpecArray;
    }

    public String getGoodsId() {
        return goodsId == null ? "" : goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsStorePrice() {
        return goodsStorePrice == null ? "" : goodsStorePrice;
    }

    public void setGoodsStorePrice(String goodsStorePrice) {
        this.goodsStorePrice = goodsStorePrice;
    }

    public String getGoodsMarketPrice() {
        return goodsMarketPrice == null ? "" : goodsMarketPrice;
    }

    public void setGoodsMarketPrice(String goodsMarketPrice) {
        this.goodsMarketPrice = goodsMarketPrice;
    }

    public String[] getGoodsGroupImage() {
        return goodsSpecArray;
    }

    public void setGoodsGroupImage(String[] goodsGroupImage) {
        this.goodsSpecArray = goodsGroupImage;
    }

    public String getBenefit() {
        return benefit == null ? "0.00" : benefit;
    }

    public void setBenefit(String benefit) {
        this.benefit = benefit;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.goodsId);
        dest.writeString(this.goodsStorePrice);
        dest.writeString(this.goodsMarketPrice);
        dest.writeString(this.benefit);
        dest.writeStringArray(this.goodsSpecArray);
    }

    protected GoodsGroupEntity(Parcel in) {
        this.goodsId = in.readString();
        this.goodsStorePrice = in.readString();
        this.goodsMarketPrice = in.readString();
        this.benefit = in.readString();
        this.goodsSpecArray = in.createStringArray();
    }

    public static final Creator<GoodsGroupEntity> CREATOR = new Creator<GoodsGroupEntity>() {
        @Override
        public GoodsGroupEntity createFromParcel(Parcel source) {
            return new GoodsGroupEntity(source);
        }

        @Override
        public GoodsGroupEntity[] newArray(int size) {
            return new GoodsGroupEntity[size];
        }
    };
}
